package com.struct.factory
{
	import com.struct.graph.room.RoomFrame;
	import com.struct.graph.room.RoomGraphWorker;
	
	import sacu.s.Factory;
	
	public class RoomFactory extends Factory
	{
		public var roomGW:RoomGraphWorker;
		public var room:RoomFrame;
		public function RoomFactory(Name:String)
		{
			super(Name);
		}
		
		override protected function onInitFactory():void{
			super.onInitFactory();
			room = new RoomFrame();
			roomGW = new RoomGraphWorker("RoomGraphWorker", room);
		}
		
		override protected function onStartFactory():void{
			registerGraphicsWorker(roomGW);
			SSA.application.uiLayer.addChild(room);
		}
		
		override public function disposeFactory():void{
			super.disposeFactory();
			removeGraphicsWorker(roomGW.eName);
			SSA.application.uiLayer.removeChild(room);
		}
	}
}